<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/calendar.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function checkForm(){
		var userName = document.getElementById("userName");										
		var parentFunctionId = document.getElementById("parentFunctionId");
		var startDate = document.getElementById("startDate");
		var endDate = document.getElementById("endDate");
		
		if(userName.value == "" && parentFunctionId.value == "0" 
			&& startDate.value == "" && endDate.value == ""){
			alert("查询条件不能为空！");
			return false;
		}
		
		if(startDate.value != ""){
			if(endDate.value == ""){
				alert("请选择访问终止日期！");
				return false;
			}
		}
		
		if(endDate.value != ""){
			if(startDate.value == "0"){
				alert("请选择访问开始日期！");
				return false;
			}
		}
		
		var d1 = "";
		var d2 = "";
		if(startDate.value != "" && endDate.value != ""){
			d1 = (startDate.value).replace("-","/");
			d2 = (endDate.value).replace("-","/");
			if(Date.parse(d1) - Date.parse(d2) >= 0){
				alert("访问终止日期不能小于等于访问开始日期！");
				return false;
			}
		}
		
		return true;
	}

	function submitQuery(){	
		var userName = document.getElementById("userName").value;										
		var parentFunctionId = document.getElementById("parentFunctionId").value;
		var startDate = document.getElementById("startDate").value;
		var endDate = document.getElementById("endDate").value;
		
		if(checkForm()){
			window.returnValue = userName + "," + parentFunctionId + "," + startDate + "," + endDate;
			self.close();
		}
	}	
	
-->
</script>
</head>
<body><br>
<form name="querySystemLogForm" action="" method="post">
	<div class="tools">
		<input class="btn1" type="button" value="确 定" onclick="submitQuery()"/>&nbsp;&nbsp;
		<input class="btn1" type="button" value="取 消" onclick="window.close();"/>&nbsp;&nbsp;
	</div>
	
<table class="table1">
	<tr>
		<td>
			<table class="table_input" cellpadding="0" cellspacing="0" style="margin: 0 0 0 50px;">
				<tr>
					<td width="20%">用户名称：</td>
					<td><input id="userName" name="userName" class="input1" type="text"/></td>
				</tr>
				<tr>
					<td width="20%">模块名称：</td>
					<td>
						<select id="parentFunctionId" name="parentFunctionId">
							<option value="0">--------请选择--------</option>
							<!-- 
							<option value="1">基础设置</option>
							<option value="2">管理设置</option>
							<option value="3">数据字典</option>
							<option value="4">系统管理</option>
							 -->
							<option value="5">客户管理</option>
							<option value="6">销售过程</option>
							<option value="7">营销财务</option>
							<option value="8">团队管理</option>
							<!-- 
							<option value="9">产品管理</option>
							 -->
							<option value="10">市场营销</option>
							<!-- 
							<option value="11">协同办公</option>
							 -->
						</select>
					</td>
				</tr>
				<tr>
					<td width="20%">访问日期：</td>
					<td>
						<input id="startDate" name="startDate" class="input1" type="text" 
							onclick="calendar(this,'yyyy-MM-dd');" readonly="readonly"/>--
						<input id="endDate" name="endDate" class="input1" type="text" 
							onclick="calendar(this,'yyyy-MM-dd');" readonly="readonly"/>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>